package logic

import (
	"context"
	"week62/common/proto/user"
	"week62/service/server"
)

type UserServer struct {
	user.UnimplementedUserServer
}

func (u UserServer) Login(ctx context.Context, req *user.LoginReq) (*user.LoginResp, error) {
	login, err := server.Login(req)
	if err != nil {
		return nil, err
	}
	return login, nil
}

func (u UserServer) SendSms(ctx context.Context, req *user.SendSmsReq) (*user.SendSmsResp, error) {
	login, err := server.SendSms(req)
	if err != nil {
		return nil, err
	}
	return login, nil
}

func (u UserServer) AddOrder(ctx context.Context, req *user.AddOrderReq) (*user.AddOrderResp, error) {
	login, err := server.AddOrder(req)
	if err != nil {
		return nil, err
	}
	return login, nil
}

func (u UserServer) SyncGoods(ctx context.Context, req *user.SyncGoodsReq) (*user.SyncGoodsResp, error) {
	login, err := server.SyncGoods(req)
	if err != nil {
		return nil, err
	}
	return login, nil
}
